import { Select, Empty } from 'antd';

export default function Abstract(props: any) {
    const { value, onChange, controlData } = props;

    const onSelectChange = (value: string[]) => {
        onChange(value);
    };

    return (
        <Select
            value={value || []}
            onChange={onSelectChange}
            options={controlData}
            mode='multiple'
            showArrow
            dropdownRender={(menu) => {
                if (controlData?.length == 0 || !controlData) {
                    return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description='暂无数据' />
                }
                return menu;
            }}
        />
    )
}